local d={[true]=1,[false]=0} local e={[1]=true,[0]=false} local _=game:GetService("RunService") local k={} local n={} n["and"]={Color=Color3.fromRGB(0,170,255),InputNum=2,OutputNum=1,Function=function(_,a,_)return d[a+_==2]end} n["nand"]={Color=Color3.fromRGB(170,0,255),InputNum=2,OutputNum=1,Function=function(_,a,_)return d[a+_<2]end} n["or"]={Color=Color3.fromRGB(255,0,255),InputNum=2,OutputNum=1,Function=function(_,a,_)return d[a+_>0]end} n["not"]={Color=Color3.fromRGB(255,0,0),InputNum=1,OutputNum=1,Function=function(_,_)return 1-_ end} n["delay"]={Color=Color3.fromRGB(0,85,0),InputNum=2,OutputNum=1,Function=function(_,a,_)wait(a) return _ end} n["dupe"]={Color=Color3.fromRGB(170,85,0),InputNum=1,OutputNum=2,Function=function(_,_)return _ end} n["xor"]={Color=Color3.fromRGB(255,97,174),InputNum=2,OutputNum=1,Function=function(_,a,_)return d[(e[a]or e[_])and(not(e[a]and e[_]))]end} n["adder"]={Color=Color3.fromRGB(1,102,0),InputNum=3,OutputNum=2,Function=function(c,b,a,_)local b,a,_=e[b],e[a],e[_] if tonumber(c)==1 then return d[((b or a)and(not(b and a))or _)and(not((b or a)and(not(b and a))and _))]elseif tonumber(c)==2 then return d[(b and a)or((b or a)and(not(b and a))and _)]end end} n["4adder"]={Color=Color3.fromRGB(1,102,0),InputNum=9,OutputNum=5,Function=function(e,d,_,b,i,c,a,f,h,g)local j={} j[1]={n["adder"].Function(1,i,h,g),n["adder"].Function(2,i,h,g)} j[2]={n["adder"].Function(1,b,f,j[1][2]),n["adder"].Function(2,b,f,j[1][2])} j[3]={n["adder"].Function(1,_,a,j[2][2]),n["adder"].Function(2,i,h,j[2][2])} j[4]={n["adder"].Function(1,d,c,j[3][2]),n["adder"].Function(2,d,c,j[3][2])} if tonumber(e)==5 then return j[4][2]else return j[5-tonumber(e)][1]end end} n["delayloop"]={Color=Color3.fromRGB(66,102,63),InputNum=1,OutputNum=1,Function=function(_,_)return d[math.floor(tick())%2==0]end} local j={} local g=CFrame.new() local l local f=Vector3.new() local o local e local h local i local function m(_)local a=Instance.new(_[1]) for b,_ in pairs(_)do if b~=1 then a[b]=_ end end return a end local a={["wire"]=function()local a=m{"SpawnLocation",Name="Wire",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(4,.4,.4),Position=owner.Character.HumanoidRootPart.Position,Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder,TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth,Parent=script} local b=a:Clone() b.Name="End1" b.Size=Vector3.new(.4,.4,.4) b.CFrame=a.CFrame*CFrame.new(-2,0,0) b.Shape=Enum.PartType.Ball b.Parent=a local _=b:Clone() _.Name="End2" _.CFrame=a.CFrame*CFrame.new(2,0,0) _.Parent=a table.insert(k,b) table.insert(k,_) table.insert(j,a)end,["light"]=function()local b=m{"SpawnLocation",Name="LightBlock",BrickColor=BrickColor.White(),Size=Vector3.new(2,1,2),Position=owner.Character.HumanoidRootPart.Position,Enabled=false,CanCollide=false,Anchored=true,TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth,Parent=script} for _=1,1 do local a=m{"SpawnLocation",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(0.1,0.8,0.8),Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder} a.Name="Input ".._ a.CFrame=b.CFrame*CFrame.new(-b.Size.X/2,0,-b.Size.Z/2+0.5+(_-1)) a.PivotOffset=a.CFrame:ToObjectSpace(b.CFrame) a.Parent=b a.AttributeChanged:Connect(function(_)if _=="Value"then b.Material=a:GetAttribute("Value")==1 and Enum.Material.Neon or Enum.Material.Plastic a.BrickColor=a:GetAttribute("Value")==1 and BrickColor.Yellow()or BrickColor.Black()end end)end for _=1,1 do local a=m{"SpawnLocation",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(0.1,0.8,0.8),Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder} a.Name="Output ".._ a.CFrame=b.CFrame*CFrame.new(b.Size.X/2,0,-b.Size.Z/2+0.5+(_-1)) a.PivotOffset=a.CFrame:ToObjectSpace(b.CFrame) a.Parent=b b["Input 1"].AttributeChanged:Connect(function(_)if _=="Value"then a.BrickColor=b["Input 1"]:GetAttribute("Value")==1 and BrickColor.Yellow()or BrickColor.Black() a:SetAttribute("Value",b["Input 1"]:GetAttribute("Value"))end end)end table.insert(k,b) table.insert(j,b)end,["switch"]=function()local b=0 local d=m{"SpawnLocation",Name="Switch",BrickColor=BrickColor.DarkGray(),Size=Vector3.new(2,1,2),Position=owner.Character.HumanoidRootPart.Position,Enabled=false,CanCollide=false,Anchored=true,TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth,Parent=script} local _=m{"ProximityPrompt",Name="ProximityPrompt",ActionText="Toggle",Parent=d} for a=1,1 do local c=m{"SpawnLocation",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(0.1,0.8,0.8),Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder} c.Name="Output "..a c.CFrame=d.CFrame*CFrame.new(d.Size.X/2,0,-d.Size.Z/2+0.5+(a-1)) c.PivotOffset=c.CFrame:ToObjectSpace(d.CFrame) c.Parent=d _.Triggered:Connect(function()b=1-b c.BrickColor=b==1 and BrickColor.Yellow()or BrickColor.Black() c:SetAttribute("Value",b)end)end table.insert(k,d) table.insert(j,d)end} a["4base10"]=function()local d=m{"SpawnLocation",Name="Base10",BrickColor=BrickColor.Blue(),Size=Vector3.new(2,1,4),Position=owner.Character.HumanoidRootPart.Position,Enabled=false,CanCollide=false,Anchored=true,TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth,Parent=script} local _=m{"SurfaceGui",Name="Gui",Face=Enum.NormalId.Top,LightInfluence=0,PixelsPerStud=50,SizingMode=Enum.SurfaceGuiSizingMode.PixelsPerStud,Parent=d} local _=m{"TextBox",Name="Text",BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Rotation=90,Font=Enum.Font.GothamBold,TextColor3=Color3.new(1,1,1),Text="0",TextScaled=true,Parent=_} local c={} local function a()local b=0 for a,_ in pairs(c)do b+=c[a]*2^(a-1)end _.Text=b end for b=4,1,-1 do local e=m{"SpawnLocation",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(0.1,0.8,0.8),Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder} e.Name="Input "..b e.CFrame=d.CFrame*CFrame.new(-d.Size.X/2,0,d.Size.Z/2-0.5-(b-1)) e.PivotOffset=e.CFrame:ToObjectSpace(d.CFrame) e.Parent=d e.AttributeChanged:Connect(function(_)if _=="Value"then local _ e.BrickColor=e:GetAttribute("Value")==1 and BrickColor.Yellow()or BrickColor.Black() c[b]=e:GetAttribute("Value") a()end end)end table.insert(k,d) table.insert(j,d)end local c={updateMouse=function(_,a,b)g,l,f=_,a,b end,mouseButton1Down=function()o=l end,mouseButton1Up=function()o=nil end} local d={new=function(_)local b=n[_] if b then local c=m{"SpawnLocation",Name=_,Color=b.Color,Locked=true,Size=Vector3.new(2,1,math.max(b.InputNum,b.OutputNum)),Position=owner.Character.HumanoidRootPart.Position,Enabled=false,CanCollide=false,Anchored=true,TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth,Parent=script} table.insert(j,c) table.insert(k,c) local a=m{"SpawnLocation",BrickColor=BrickColor.Black(),Locked=true,Size=Vector3.new(0.1,0.8,0.8),Enabled=false,CanCollide=false,Anchored=true,Shape=Enum.PartType.Cylinder} for _=1,b.InputNum do local a=a:Clone() a.Name="Input ".._ a.CFrame=c.CFrame*CFrame.new(-c.Size.X/2,0,-c.Size.Z/2+0.5+(_-1)) a.PivotOffset=a.CFrame:ToObjectSpace(c.CFrame) a.Parent=c end for _=1,b.OutputNum do local a=a:Clone() a.Name="Output ".._ a.CFrame=c.CFrame*CFrame.new(c.Size.X/2,0,-c.Size.Z/2+0.5+(_-1)) a.PivotOffset=a.CFrame:ToObjectSpace(c.CFrame) a.Parent=c end elseif a[_]then a[_]()end end} local function b()for _,b in pairs(j)do local c=n[b.Name] if c then local a={} for _,d in pairs(b:GetChildren())do local b,_=table.unpack(string.split(d.Name," ")) if b=="Input"then local b=0 for _,_ in pairs(d:GetChildren())do if _:IsA("ObjectValue")and _.Name=="ConnectedTo"then b=_ and _.Value and _.Value.ConnectedTo.Value==d and d:GetAttribute("Value")or 0 end end table.insert(a,b) d.BrickColor=b==1 and BrickColor.Yellow()or BrickColor.Black()elseif b=="Output"then local _=c.Function(_,table.unpack(a)) d.BrickColor=_==1 and BrickColor.Yellow()or BrickColor.Black() d:SetAttribute("Value",_)end end else if b.Name=="Wire"then local _=((b.End1:FindFirstChild("ConnectedTo")and b.End1.ConnectedTo.Value and string.find(b.End1.ConnectedTo.Value.Name,"Output")and b.End1.ConnectedTo.Value:GetAttribute("Value")==1)or(b.End2:FindFirstChild("ConnectedTo")and b.End2.ConnectedTo.Value and string.find(b.End2.ConnectedTo.Value.Name,"Output")and b.End2.ConnectedTo.Value:GetAttribute("Value")==1))and 1 or 0 local a=(b.End1:FindFirstChild("ConnectedTo")and b.End1.ConnectedTo.Value and string.find(b.End1.ConnectedTo.Value.Name,"Input")and b.End1.ConnectedTo.Value or nil)or(b.End2:FindFirstChild("ConnectedTo")and b.End2.ConnectedTo.Value and string.find(b.End2.ConnectedTo.Value.Name,"Input")and b.End2.ConnectedTo.Value or nil)or nil if a then a:SetAttribute("Value",_)end local a=_==1 and BrickColor.Yellow()or BrickColor.Black() b.BrickColor=a for _,_ in pairs(b:GetChildren())do _.BrickColor=a end b.Size=Vector3.new((b.End1.Position-b.End2.Position).Magnitude,0.4,0.4) b.CFrame=CFrame.lookAt(b.End1.Position,b.End2.Position)*CFrame.new(0,0,-b.Size.X/2)*CFrame.Angles(0,math.rad(90),0)end end end if o and table.find(k,o)then i.FillColor=Color3.fromRGB(0,200,255) i.FillTransparency=0 i.Parent=o if o.Parent.Name~="Wire"then o.Position=g+f*o.Size.Y/2 for _,a in pairs(o:GetChildren())do if a:IsA("BasePart")then a:PivotTo(o.CFrame) for _,_ in pairs(a:GetChildren())do if _.Name=="ConnectedTo"and _:IsA("ObjectValue")and _.Value and _.Value.ConnectedTo.Value==a then _.Value.Position=a.Position end end end end else local _=(type(l)=="userdata"and table.find(j,l.Parent)and l.Parent~=o.Parent)and l or nil if _ then o.Position=_.Position if o:FindFirstChild("ConnectedTo")then o.ConnectedTo.Value=_ else m{"ObjectValue",Name="ConnectedTo",Value=_,Parent=o}end m{"ObjectValue",Name="ConnectedTo",Value=o,Parent=_}else o.Position=g if o:FindFirstChild("ConnectedTo")then if o.ConnectedTo.Value and not n[o.ConnectedTo.Value.Parent.Name]then for _,_ in pairs(o.ConnectedTo.Value:GetChildren())do if _.Name=="ConnectedTo"and _:IsA("ObjectValue")and _.Value==o then _:Destroy()end end end o.ConnectedTo.Value=nil end end end else i.FillColor=Color3.fromRGB(11,90,175) i.FillTransparency=0.5 i.Parent=table.find(k,l)and l or nil end end local function a()e=NLS([[ local _=false local d=script:WaitForChild("Remote") local b local e=owner:GetMouse() local c=RaycastParams.new() c.FilterType=Enum.RaycastFilterType.Blacklist d.OnClientEvent:Connect(function(a,...)if a=="getInfo"then b=... _=true end end) local function a()local c=workspace:Raycast(workspace.CurrentCamera.CFrame.Position,(e.Hit.Position-workspace.CurrentCamera.CFrame.Position).Unit*1e9,c) local _=Vector3.new() local b=Vector3.new() local a if c then _=c.Position a=c.Instance b=c.Normal end d:FireServer("updateMouse",_,a,b)end local function b()d:FireServer("mouseButton1Down") c.FilterDescendantsInstances={e.Target,e.Target.Parent and e.Target.Parent:IsA("BasePart")and e.Target.Parent or nil}end local function _()d:FireServer("mouseButton1Down") c.FilterDescendantsInstances={}end e.Move:Connect(a) e.Button1Down:Connect(b) e.Button1Up:Connect(_) ]],owner.PlayerGui) h=m{"RemoteEvent",Name="Remote",Parent=e} h:FireClient(owner,"getInfo",script) i=m{"Highlight",Name="SelectionHighlight",DepthMode=Enum.HighlightDepthMode.Occluded,FillColor=Color3.fromRGB(11,90,175),FillTransparency=0.5,OutlineColor=Color3.fromRGB(0,200,255)}end a() h.OnServerEvent:Connect(function(_,_,...)if c[_]then c[_](...)end end) _.Heartbeat:Connect(b) owner.Chatted:Connect(function(_)local a,_=table.unpack(string.split(_,": ")) local b,_=table.unpack(string.split(_ or""," ")) if d[b]and a=="/e c"then d[b](_)end end)